<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="z" uri="http://www.liuhuazhi.com/diancan"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>菜品列表</title>
<link rel="stylesheet" href="${ctx}/css/goods/goodsSelect.css" />
<link rel="stylesheet" href="${ctx}/css/admin/admin.css" />
<script type="text/javascript" src="${ctx }/js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="${ctx }/js/jquery.form.js"></script>
<script type="text/javascript" src="../js/layer/layer.js"></script>
<script type="text/javascript" src="${ctx }/js/goods/goodsSelect.js"></script>
</head>
<script type="text/javascript">
var domain="${ctx}/";
</script>
<body>
	<div class="head">
		<h4>菜品列表</h4>
	</div>
	<div class="head_item">
		<div class="header">
			<div class="cai">搜索菜品：</div>
			<div class="input_find">
				<form action="${ctx }/goods/toGoodsSelect" name="search" method="get">
					<input type="hidden" name="pageNow" value="1"/>
					<input type="hidden" name="pageSize" value="10"/>
					<table border="0" cellpadding="0" cellspacing="0"
						class="tab_search">
						<tr>
							<td> <input
								type="text" name="goodsName" title="Search" class="searchinput"
								id="searchinput" value=""
								onkeyup="value=value.replace(/[^\a-\z\A-\Z\u4E00-\u9FA5]/g,'')"
								placeholder="请输入商品名称"
								onfocus="this.value='';" /></td>
							<td>
							<td><input type="image" width="21" height="17"
								class="searchaction" alt="Search" src="${ctx }/image/magglass.gif"
								border="0" />
							</td>
							
						</tr>
					</table>
				</form>
			</div>
			<c:set var="z" value="${map.goodsType}"></c:set>
			<div class="cai2" >菜品分类：</div>
			<div class="select_div">
				<select name="select" class="selectedd" id="selectGoodsType">
					<option value="9999">全部菜式</option>
					<c:forEach items="${map.goodsTypeList}" var="tl">
						<c:if test="${tl.typeId==z}" var="x">
							<option value="${tl.typeId}" selected="selected">${tl.type}</option>
						</c:if>
						<c:if test="${not x}">
							<option value="${tl.typeId}">${tl.type}</option>
						</c:if>
					</c:forEach>
				</select>
			</div>
			<div class="cai">
				<button class="btn1">新增菜品</button>
			</div>
		</div>
		<table class="table1" style="border-top: 1px solid">
			<tr>
				<th>菜名</th>
				<th>介绍</th>
				<th>价格</th>
				<th>销售量</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${map.goodsList}" var="gv">
				<tr>
					<td style="width: 10%; font-size: 10px"><div
							style="width: 70px; height: 70px; margin: 0 auto">
							<c:if test="${not empty gv.image }">
								<img src="upload/${gv.image }" width="50px" height="45px"
									style="padding-bottom: 3px">
							</c:if>
							<c:if test="${ empty gv.image }">
								<img src="${ctx }/image/noImg.png" width="50px" height="45px"
									style="padding-bottom: 3px">
							</c:if>
							<br>${gv.goodsName}
						</div></td>
					<td class="td_detail">${gv.detail }</td>
					<td style="width: 5% ；">${gv.price}元/份</td>
					<td style="width: 5%">${gv.saleNum}</td>
					<!-- 0销售中 1售完  -->
					<td><c:if test="${gv.status==0}">
							<img src="${ctx }/image/selling.png" width="20px" height="20px">
						</c:if> <c:if test="${gv.status==1}">
							<img src="${ctx }/image/sellout.png" width="20px" height="25px">
						</c:if></td>
					<td style="width: 30%">
						<a href="#" class="update" gid="${gv.goodsId}" title="修改信息">
							<img alt="修改菜品信息" src="${ctx }/image/update.png" width="20px"
							height="20px">
						</a>
						<a href="javascript:void(0)" class="upload"
							gid="${gv.goodsId}" title="上传图片"> <img alt="上传图片"
							src="${ctx }/image/pngup.png" width="20px" height="20px">
						</a>
						<a href="javascript:void(0)" class="deleteImg"
							gid="${gv.goodsId}" title="删除图片"> <img alt="删除图片"
							src="${ctx }/image/pngshan.png" width="20px" height="20px">
						</a>
						<a href="javascript:void(0)" class="deleteGoods"
							gid="${gv.goodsId}" title="删除商品"><img alt="删除商品"
							src="${ctx }/image/delete.png" width="20px" height="20px"></a>
						<a href="javascript:void(0)" class="shangxia"
							gid="${gv.goodsId}" title="上下架商品"><img alt="上下架商品"
							src="${ctx }/image/shangxia.png" width="20px" height="20px"></a>
					</td>
				</tr>
			</c:forEach>
		</table>
		<input type="hidden" id="total" value="${map.total}" />
		<jsp:include   page="pagination.jsp" flush="true"/>
	</div>
	<div class="blackbg"></div>
	<!-- 商品修改弹出层 -->
	<div class="popContent popContent1">
		<div class="popTop">
			<a href="javascript:void(0)" class="bluebtn closebtn"></a>
			<p>商品修改</p>
		</div>
		<div class="poptext">
			<div class="modifydiv">
				<ul class="xgxxlist">
					<li><span>商品名称：</span>
					<p>
							<input type="text" name="" class="xipt" id="updateGoodsName">
						</p></li>
					<li><span>商品价格：</span>
					<p>
							<input type="text" name="" class="xipt" id="updateGoodsPrice" 
								onkeyup="this.value=this.value.replace(/[^\d.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">
						</p></li>
					<li><span>商品描述：</span>
					<p>
							<textarea  class="xipt" id="updateGoodsDetail" ></textarea>
						</p></li>
				</ul>
			</div>
			<div class="popbtndiv">
				<a href="javascript:void(0);" class="qdbtn" id="updateGoods">确定</a>
				<a href="javascript:void(0);" class="qxbtn">取消</a>
			</div>
		</div>
	</div>
	
</body>
</html>